<template>
  <div class="m-header f-cb">
  	<div class="warp">
	  	<a href="/"><img src="../assets/images/logo.png"></a>
	  	<ul class="m-herder-nav" v-if="headstatus == false">
	  		<li><a href="/login">登录</a></li>
	  		<li><a class="m-header-act" href="/register">注册</a></li>
	  	</ul>
	  	<ul class="m-herder-username" v-else>
	  		<li>{{ username }}</li>
	  	</ul>
  	</div>
  </div>
</template>
<script>
	export default {
		data(){
			return {
				headstatus:false,
				username:'',
			}
		},
		created(){
			var that = this;
			if(that.getCookie('userinfo')){
				var userinfo = JSON.parse(that.getCookie('userinfo'));
				if(userinfo){
					that.headstatus = true;
					that.username = userinfo.name;
				}else{
					that.status = false;
				}				
			}
		},
		methods: {
			
		},

	}
</script>